#ifndef __INOTIFY_HELPER_H
#define __INOTIFY_HELPER_H

#include "inotify-sub.h"
#include "inotify-kernel.h"

typedef void ( *event_callback_t )( const char *fullpath, guint32 mask, void *subdata );
typedef void ( *found_callback_t )( const char *fullpath, void *subdata );

gboolean   ih_startup( event_callback_t ecb,
                       found_callback_t fcb );
gboolean   ih_running( void );
gboolean   ih_sub_add( ih_sub_t *sub );

/* Return FALSE from 'f' if the subscription should be cancelled */
void     ih_sub_foreach( void *callerdata, gboolean( *f )( ih_sub_t *sub, void *callerdata ) );

/* Return FALSE from 'f' if the subscription should be cancelled and free'd */
void     ih_sub_foreach_free( void *callerdata, gboolean( *f )( ih_sub_t *sub, void *callerdata ) );

#endif /* __INOTIFY_HELPER_H */
